
#include "CentralWidgetOperation.hpp" 
#include "../OLApp/CommandsManager.hpp"  
#include "../OLCommands/CentralWidgetCommands.hpp"






namespace NSOperation {

	CentralWidgetOperation::CentralWidgetOperation() :
		NSCore::AbstractOperation()
	{


	}

	CentralWidgetOperation::~CentralWidgetOperation() {

	}

	void CentralWidgetOperation::actionPerspectiveChangedSlot(bool off) { 
//		executeCommandBegin(PerspectiveCommand, off)
//			QString(R"*(
//		"from Exchange import open"
//		"open.OpenStep('.....')"
//)*")
//		executeCommandEnd

		NSCommands::PerspectiveCommand* cmd = new NSCommands::PerspectiveCommand(off);
		cmd->setExecuteDoc("PerspectiveChanged");
		cmd->setUndoDoc("PerspectiveChanged");
		myManager(CommandsManager)->execute(cmd);
	}


	void CentralWidgetOperation::actionRenderObjectDisplaySlot(QAction* action) {
//		executeCommandBegin(ObjectDisplayCommand, action)
//			QString(R"*(
//		"from Exchange import open"
//		"open.OpenStep('.....')"
//)*")
//		executeCommandEnd

		myManager(CommandsManager)->execute(new NSCommands::ObjectDisplayCommand(action)); 
	}


	void CentralWidgetOperation::actionViewDirectionChangedSlot(int index) {
		/*index : 0-xoy 1-yox 2-yoz 3-zoy 4-zox 5-xoz 6-xyz*/
		myManager(CommandsManager)->execute(new NSCommands::ViewDirectionCommand(index)); 
	}

	void CentralWidgetOperation::actionViewAdaptSlot() {		
		myManager(CommandsManager)->execute(new NSCommands::ViewAdaptCommand); 
	}

	void CentralWidgetOperation::actionViewMagnifySlot() {	
		myManager(CommandsManager)->execute(new NSCommands::ViewMagnifyCommand); 
	}

	void CentralWidgetOperation::actionViewShrinkSlot() {
		myManager(CommandsManager)->execute(new NSCommands::ViewShrinkCommand); 
	}

}